package client;

public class Protocol {
	public static final String SPLIT = "#split#"; 
	
	public static String createUser(User user){
		String s = "CREATE USER"+SPLIT+user.name+SPLIT+user.lastName+SPLIT+user.username+SPLIT+user.password+SPLIT+user.email;
		return s;
	}
	
	public static String logIn(String userName, String password){
		String s = "LOGIN USER"+SPLIT+userName+SPLIT+password;
		return s;
	}
	
	public static String logOut(){
		String s = "CLOSE CONNECTION";
		return s;
	}
	
	public static String createList(List list, User user){
		String s = "CREATE LIST"+ SPLIT+list.listName+SPLIT+user.name+SPLIT;
		return s;
	}
	
	public static String createCriteria(String name){
		String s = "CREATE CRITERIA"+SPLIT+name;
		return s;
	}
	
	public static String createItem(Item item){
		String s = "CREATE ITEM"+SPLIT+item.itemName+SPLIT+item.userName;
		return s;
		
	}
	
	public static String vote(List list, Item item, String criteria){
		String s = "ADD VOTE"+SPLIT+list.listName+SPLIT+item.itemName+SPLIT+criteria;
		return s;
	}
	
}


